﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpMap.Wpf
{
    public class SimpleContextManager : ContextManager
    {
        private IDictionary<Type, object> _items = new Dictionary<Type, object>();

        public IDictionary<Type, object> Items
        {
            get { return _items; }
        }


        public override object GetValue(Type itemType)
        {
            if (itemType == null)
            {
                throw new ArgumentNullException("itemType");
            }
            object retVal = null;
            Items.TryGetValue(itemType, out retVal);
            return retVal;

        }

        public override void SetValue(object value)
        {
            throw new NotImplementedException();
        }

        public override System.Collections.IEnumerator GetEnumerator()
        {
            return Items.Values.GetEnumerator();
        }
    }
}
